<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心_<%=zych_home%></title>
<meta name="keywords" content="<%=zych_keywords%>" />
<meta name="description" content="<%=zych_description%>" />
<link href="<%=zych_templatedir%>css/style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=dir%>js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<%=zych_templatedir%>js/menu.js"></script>
<script type="text/javascript" src="<%=zych_templatedir%>js/superslide.2.1.js"></script>
<script language="javascript">
$(document).ready(function()
{
$("#btnSnap").click(function()
{
    $("#retData").html('loading...');
    var expressid = $("#expressid").val();
    var expressno = $("#expressno").val();
    $.get("express.asp",{com:expressid,nu:expressno},
        function(data)
        {
            $("#retData").html(data);
        }
    );
    return false;
});
});
</script>
</head>
<body>
<!--#include file="top.asp"-->
<div id="mainpd">
<div class="in_title"><p><b>会员中心</b></p><a href="#" target="_blank" class="more"><%=zych_daohangnr%></a></div>
<div class="main_700 fl" id="main_700">
<div id="position"><strong>当前位置：</strong><a href="<%=dir%>">首页</a><a href="<%=dir%>User">会员中心</a><%=usurl%></div>
<div class="user">
<%if action="admin" then%>
<div class="ubox">
<table width="100%" border="1" cellpadding="6" cellspacing="0" bordercolor="#EDEDED">
<tr>
<td width="52%" colspan="2">
<% 
set rs=server.createobject("adodb.recordset") 
exec="select * from [user] where id="&session("username")&"  " 
rs.open exec,conn,1,1 
response.write(rs("zsname")&"<a href=""../User/index.asp"">["&rs("username")&"]</a>&nbsp;欢迎您！会员等级："&userkey(u_key)&"")
%></td>
    </tr>
    <% If rs("sex")="" and rs("gsadd")="" and rs("mail")="" Then %>
  <tr>
    <td colspan="2" align="center" bgcolor="#FFFF33" style="font-size:14px">亲爱的[<%=rs("username")%>]您的信息资料还不完整很在[我的资料]中填写完整！</td>
   </tr>
   <% End If %>
  <tr>
    <td width="52%" align="center"><a href="../User/?action=Edit">我的资料</a></td>
    <td width="48%" align="center"><a href="../User/?action=orders">我的订单</a></td>
  </tr>
  <tr>
    <td align="center"><a href="../User/?action=password">修改密码</a></td>
    <td align="center"><a href="../User/?action=loginOUT">退出登陆</a></td>
  </tr>
</table>
</div>
<div class="ubox">
<div class="pronav"><h1>最近订单</h1></div>
<table width="100%"  border="1" cellpadding="6" cellspacing="0" bordercolor="#EDEDED" style="border-collapse: collapse;line-height:25px; text-indent:3px">
<tr>
    <td width="19%" align="center"><strong>订单编号</strong></td>
    <td width="17%" align="center"><strong>订单金额</strong></td>
    <td width="18%" align="center"><strong>联系电话</strong></td>
    <td width="18%" align="center"><strong>时 间</strong></td>
    <td width="16%" align="center"><strong>状 态</strong></td>
    <td colspan="2" align="center"><strong>操 作</strong></td>
    </tr>
		<%	
        set rs=server.createobject("adodb.recordset") 
        exec="select * from [orders] where userid="&session("username")&" order by id desc "  
        rs.open exec,conn,1,1 
        if rs.eof then
        response.Write "<tr><td colspan=""5"" align=""center"">暂无订单...</td></tr>"
        else
        while not rs.eof
        if rs("state")=1 then
        ddzt="<a href="""&dir&"Order/"&alipayLX&"/alipayapi.asp?id="&rs("id")&""" title=""点击这里完成付款""><font color=#FF0000>等待买家付款</font></a>"
        elseif rs("state")=2 then
        ddzt="已付款，等待发货"
        elseif rs("state")=3 then
        ddzt="已发货，等待确认"
        elseif rs("state")=8 then
        ddzt="交易完成"
        else
        ddzt="订单出现异常"
       end if%>
  <tr>
    <td width="19%" align="center"><a href="?action=Sorders&id=<%=rs("id")%>" title="点击查看订单详情"><%=rs("OrderNo")%></a></td>
    <td width="17%" align="center"><%=lz_money(Rs("rmb"))%></td>
    <td width="18%" align="center"><%=rs("tel")%></td>
    <td width="18%" align="center"><%=rs("data")%></td>
    <td width="16%" align="center"><%=ddzt%></td>
    <td width="6%" align="center"><a href="?action=Sorders&id=<%=rs("id")%>">查看</a></td>
    <td width="6%" align="center"><a href="javascript:void(0);" onClick="javascript:if(confirm('确定删除该订单？删除后不可恢复!')){window.location.href='?action=admin&id=<%=rs("id")%>&amp;del=ok';}else{history.go(0);}" title="删除此订单">删除</a></td>
  </tr>
<%rs.movenext
wend
end if
rs.close
set rs=nothing%>
</table>
</div>
<div class="ubox">
<div class="pronav"><h1>产品推荐</h1></div>
<%set rs=server.createobject("adodb.recordset") 
exec="select top 4 * from Content where SortType=4 and  isok=1 and tuijian=1 order by px_id desc,Cid desc"
rs.open exec,conn,1,1
if rs.eof then
response.Write "<div style=""padding:10px"">暂无产品</div>"
else
while not rs.eof%>
<div class="list_box">
<a href="<%=zych_show_url(rs("SortID"),rs("Cid"))%>" title="<%=rs("title")%>"><img src="<%=rs("img")%>" width="234" height="150" alt="<%= rs("title") %>" onerror="this.src='images/nologo.jpg'"/><p><%= stvalue(rs("title"),21) %></p></a>
</div>
<%rs.movenext
wend
end if
rs.close
set rs=nothing%>
</div>
<%end if
if action="Gcar" then%>
<div class="ubox">
<div class="pronav"><h1>我的购物车</h1></div>
<% 
act =Request.QueryString("act")
cid =Request.QueryString("cid")

allid = Request.Cookies("productlist")'调入查询物品的id
If Request.Cookies("productlist") ="" Then
  allid = 0
Else
  allid = Request.Cookies("productlist")
End If
If act ="del" Then	 '删除购物车中的某一件商品
	aProducts = Split(Request.Cookies("productlist"),",")
	delid = cstr(trim(cid))
	For i = 0 To UBound(aProducts)    '循环所有商品ID
		If Trim(aProducts(i)) <> delid Then
			'不等于被删除的ID时则保存进新的列表中
			sNewProducts = sNewProducts & "," & aProducts(i)
		End If
	Next
	Response.Cookies("productlist") = Mid(sNewProducts,2)
	Response.Write "<script>alert('删除成功');history.go(-1);</script>" 
End If%>
<table width="100%" border="1" cellpadding="6" cellspacing="0" bordercolor="#EDEDED" class="buy_tab" id="buy_tab">
 <tr bgcolor="#EEEEEE">
     <td colspan="2">产品信息</td>
     <td width="80"  align="center" valign="middle">价格</td>
     <td width="100" align="center" valign="middle">数量</td>
     <td width="40"  align="center" valign="middle">清除</td>
 </tr>	
 	 
<%
Set Rs = Server.CreateObject("adodb.recordset")
If allid<>0 and allid<>"" Then allcid=allid else allcid=0
Sql = "Select * From [content] Where Cid In ("&allcid&") Order By Cid" '这里替换成实际的商品数据库及字段
Rs.Open Sql,Conn,1,1
if rs.eof then
response.Write "<tr><td colspan=5>购物车内没有商品...</td></tr>"
else
Do While Not Rs.Eof%>
	<tr id="buybox">
	<td width="70"><img src="<%=Rs("img")%>" width="90" height="60" /></td>
	<td><a href="<%=zych_show_url(rs("SortID"),rs("Cid"))%>" title="<%=Rs("title")%>" target="_blank"><%=Rs("title")%></a></td>
	<td align="center" valign="middle"><strike style="color:#666666"><%=lz_money(Rs("yrmb"))%></strike><br/><span class="price"><%=lz_money(Rs("xrmb"))%></span></td>
	<td align="center" valign="middle"><input name="xrmb" type="hidden" value="<%=Rs("xrmb")%>"/> 
	<input class="min" name="" type="button" value="-"  style="background:#DDD"/> 
	<input class="text_box" name="num_<%=Rs("Cid")%>" type="text" value="1" size="2" style="text-align:center"/> 
	<input class="add" name="" type="button" value="+" style="background:#DDD"/>
	</td>
	<td align="center" valign="middle">
	<input name="pid" value="<%=Rs("Cid")%>" type="hidden" size="50"/><input name="money_<%=Rs("Cid")%>" value="<%=lz_money(Rs("xrmb"))%>" type="hidden" /><a href="?action=Gcar&Cid=<%=Rs("Cid")%>&act=del"><span class="cha">×</span></a>
	</td>
	</tr> 
<%
Rs.Movenext
Loop
end if
Rs.Close:Set Rs = Nothing%>
</table>
<p style="margin:10px 0px;">总额：<label id="total"></label> 元 <input name="" value="确认无误 提交" class="btn-u"  style="float:right" type="button" id="btn_buy_submit"/></p>
</div>
<%end if
if action="Edit" then%>
<div  class="ubox">
<div class="pronav"><h1>我的资料</h1></div>
<%set rs=server.createobject("adodb.recordset") 
exec="select * from [user] where id="&session("username")&"  " 
rs.open exec,conn,1,1 %>
<table width="100%"  border="1" cellpadding="6" cellspacing="0" bordercolor="#EDEDED" style="border-collapse:collapse; margin-top:10px; text-indent:3px">  
<form action="?action=Edit&id=<%=rs("id")%>&xiugai=info" method="post" name="add">
	<tr>
      <td width="18%" align="right">登陆帐号：</td>
      <td height="30"><%=rs("username")%>
        <input name="id" type="hidden" value="<%=rs("id")%>" /></td>
      </tr>
    <tr>
      <td align="right">真实姓名：</td>
      <td height="30"><input name="zsname" type="text" class="inp" value="<%=rs("zsname")%>" size="30" /></td>
      </tr>
    <tr>
      <td align="right">性别：</td>
      <td height="30"><label class="inp"><input type="radio" name="sex" value="先生" <%if rs("sex")="先生" then%>checked<%end if%>>先生</label>　 
        <label class="inp"><input type="radio" name="sex" value="女士" <%if rs("sex")="女士" then%>checked<%end if%>>女士</label></td>
      </tr>
    <tr>
      <td align="right">公司名称：</td>
      <td height="30"><input name="gsname" type="text" class="inp" value="<%=rs("gsname")%>" size="30" /></td>
      </tr>
    <tr>
      <td align="right">详细地址：</td>
      <td height="30"><input name="gsadd" type="text" class="inp" value="<%=rs("gsadd")%>" size="40" /></td>
      </tr>
    <tr>
      <td align="right">邮政编码：</td>
      <td height="30"><input name="youbian" type="text" class="inp" value="<%=rs("youbian")%>" size="20" /></td>
      </tr>
    <tr>
      <td align="right">联系电话：</td>
      <td height="30"><input name="tel" type="text" class="inp" value="<%=rs("tel")%>" size="30" /></td>
      </tr>
      <tr>
      <td align="right">联系QQ：</td>
      <td height="30"><input name="qq" type="text" class="inp" value="<%=rs("qq")%>" size="30" /></td>
      </tr>
    <tr>
      <td align="right">电子邮箱：</td>
      <td height="30"><input name="mail" type="text" class="inp" value="<%=rs("mail")%>" size="30" /></td>
      </tr>
    <tr>
      <td align="right">公司网址：</td>
      <td height="30"><input name="wz" type="text" class="inp" value="<%=rs("wz")%>" size="30" /></td>
      </tr>
    <tr>
      <td align="right">注册时间：</td>
      <td height="27"><%=rs("data")%></td>
      </tr>
    <tr>
      <td align="right">注册IP：</td>
      <td height="30"><%=rs("ip")%></td>
      </tr>
    <tr>
      <td align="right">登陆次数：</td>
      <td height="30"><%=rs("dlcs")%></td>
      </tr>
    <tr>
      <td align="right">最后登陆：</td>
      <td height="30"><%=rs("dldata")%></td>
      </tr>
    <tr>
      <td height="27" align="right">&nbsp;</td>
      <td><label><input name="button" type="submit" class="send" id="button" value="更新资料" /></label></td>
      </tr>
      </form>
  </table>
<%rs.close
set rs=nothing%>
</div>
<%end if
if action="password" then%>
<div class="ubox">
<div class="pronav"><h1>修改密码</h1></div>
<%set rs=server.createobject("adodb.recordset") 
exec="select * from [user] where id="&session("username")&"  " 
rs.open exec,conn,1,1 %>
<form action="?action=password&xiugai=pass" method="post" name="add">
<table width="100%"  border="1" cellpadding="6" cellspacing="0" bordercolor="#D8D8D8" style="border-collapse: collapse;line-height:25px; text-indent:3px">
    <tr>
      <td width="19%" height="30">登陆帐号：</td>
      <td><%=rs("username")%><input name="id" type="hidden" value="<%=rs("id")%>" /></td>
      </tr>
    <tr>
      <td height="30">登陆密码：</td>
      <td><input name="userpassword" type="text" class="inp" size="30" />        6-12位,字母、数字或下划线</td>
      </tr>
    <tr>
      <td height="30">重复密码：</td>
      <td><input name="userpassword2" type="text" class="inp" size="30" />        同上</td>
      </tr>
    <tr>
      <td height="30">&nbsp;</td>
      <td><label><input name="button" type="submit" class="send" id="button" value="修改密码" /></label></td>
      </tr>
  </table></form>
</div>
<%End If
if action="orders" then%>
<div class="ubox">
<div class="pronav"><h1>我的订单</h1></div>
<table width="100%" border="1" cellpadding="10" cellspacing="0" bordercolor="#EDEDED" style="margin-top:10px">
  <tr>
    <td width="25" align="center">1.等待买家付款</td>
    <td width="25" align="center">2.已付款,等待发货</td>
    <td width="25" align="center">3.已发货,等待确认收货</td>
    <td width="25" align="center">4.确认收货,交易完成</td>
  </tr>
</table>
<table width="100%"  border="1" cellpadding="6" cellspacing="0" bordercolor="#EDEDED" style="border-collapse: collapse;line-height:25px; text-indent:3px">
<tr>
    <td width="19%" align="center"><strong>订单编号</strong></td>
    <td width="17%" align="center"><strong>订单金额</strong></td>
    <td width="18%" align="center"><strong>联系电话</strong></td>
    <td width="18%" align="center"><strong>时 间</strong></td>
    <td width="16%" align="center"><strong>状 态</strong></td>
    <td colspan="2" align="center"><strong>操 作</strong></td>
    </tr>
<%	
set rs=server.createobject("adodb.recordset") 
exec="select * from [orders] where userid="&session("username")&" order by id desc "  
rs.open exec,conn,1,1 
if rs.eof then
response.Write "<td colspan=""5"" align=""center"">暂无订单...</td>"
else
rs.PageSize =15 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount 
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif  page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if	
For i=1 To x
if rs("state")=1 then
ddzt="<a href="""&dir&"alipay/"&alipayLX&"/alipayapi.asp?id="&rs("id")&""" title=""点击这里完成付款""><font color=#FF0000>等待买家付款</font></a>"
elseif rs("state")=2 then
ddzt="已付款，等待发货"
elseif rs("state")=3 then
ddzt="已发货，等待确认收货"
elseif rs("state")=8 then
ddzt="交易完成"
else
ddzt="订单出现异常"
end if%>
<tr>
    <td width="19%" align="center"><a href="?action=Sorders&id=<%=rs("id")%>" title="点击查看订单详情"><%=rs("OrderNo")%></a></td>
    <td width="17%" align="center"><%=lz_money(Rs("rmb"))%></td>
    <td width="18%" align="center"><%=rs("tel")%></td>
    <td width="18%" align="center"><%=rs("data")%></td>
    <td width="16%" align="center"><%=ddzt%></td>
    <td width="6%" align="center"><a href="?action=Sorders&id=<%=rs("id")%>">查看</a></td>
    <td width="6%" align="center"><a href="javascript:void(0);" onClick="javascript:if(confirm('确定删除该订单？删除后不可恢复!')){window.location.href='?action=orders&id=<%=rs("id")%>&amp;del=ok';}else{history.go(0);}" title="删除此订单">删除</a></td>
</tr>
<%rs.movenext
next
end if%>
</table>

<%'以下显示分页
echo PageControl(iCount,maxpage,page)
rs.close
set rs=nothing%>
</div>
<%End If
if action="Sorders" then%>
<div class="ubox">
<div class="pronav"><h1>订单详情</h1></div>
<%id=request.QueryString("id")
if id="" or not isnumeric(id) then
Response.Write "<script>alert('参数错误！');history.go(-1);</script>" 
Response.End()
end if
exec="select * from [orders] where id="& id 
set rs=server.createobject("adodb.recordset") 
rs.open exec,conn,1,1 
if rs.eof and rs.bof then
Response.Write "<script>alert('参数不正确，ID值不存在！');history.go(-1);</script>" 
Response.End()
end if
title=split(rs("title"),"|")
Cid=split(rs("Cid"),"|")
num=split(rs("number"),"|")
xrmb=split(rs("xrmb"),"|")

if rs("state")=1 then
ddzt="<a href="""&dir&"alipay/"&alipayLX&"/alipayapi_re.asp?id="&rs("id")&""" title=""点击这里完成付款""><font color=#FF0000>等待买家付款</font></a>"
elseif rs("state")=2 then
ddzt="买家已付款，等待发货"
elseif rs("state")=3 then
ddzt="已发货，等待确认收货"
elseif rs("state")=8 then
ddzt="交易完成"
else
ddzt="订单出现异常"
end if
%>

<div class="schedule">
 <div class="zline">
 <span>确认订单</span>
 <div class="jda<%If rs("state")>=1 Then%>on<%End If%>"><b>1</b></div>
 </div>
  <div class="zline">
 <span>买家付款</span>
 <div class="jdb<%If rs("state")>=2 Then%>on<%End If%>"><b>2</b></div>
 </div>
 
  <div class="zline">
  <span>卖家发货</span>
 <div class="jdb<%If rs("state")>=3 Then%>on<%End If%>"><b>3</b></div>
 </div>
  <div class="zline">
  <span>确认收货</span>
 <div class="jdb<%If rs("state")>=8 Then%>on<%End If%>"><b>4</b></div>
 </div>
 
 <div class="zline">
 <span>完成交易</span>
 <div class="jdc<%If rs("state")>=8 Then%>on<%End If%>"><b>5</b></div>
 </div>
</div>
<table width="100%"  border="0" cellpadding="6" cellspacing="0" bordercolor="#EDEDED">
 <tr>
   <td width="11%" align="right">订单编号：</td>
   <td width="27%"><%=rs("OrderNo")%></td>
   <td width="15%" align="right">支付宝交易号</td>
   <td width="47%"><%=rs("trade_no")%></td>
 </tr>
 <tr>
   <td width="11%" align="right">订单时间：</td>
   <td width="27%"><%=rs("data")%></td>
   <td width="15%" align="right">交易状态</td>
   <td width="47%"><%=ddzt%></td>
 </tr>
<tr>
  <td colspan="4" align="right">
  <table width="100%"  border="1" cellpadding="6" cellspacing="0" bordercolor="#EDEDED" style="border-collapse:collapse;line-height:25px; text-indent:3px; margin:5px 0;">
    <tr bgcolor="#E7F7FA">
      <td colspan="2" align="center"> 产品名称</td>
      <td width="100" align="center">单价</td>
      <td width="100" align="center">数量</td>
      <td width="100" align="center">金额</td>
    </tr>
<%for ii=0 to ubound(title)%>
    <tr>    
      <td align="center">图片</td>
      <td align="left"><%=title(ii)%></td>
      <td align="center"><%=lz_money(xrmb(ii))%></td>
      <td align="center"><%=num(ii)%></td>
      <td align="center"><%=lz_money(xrmb(ii)*num(ii))%></td>
    </tr>
<%next%>
  </table></td>
</tr>
<tr>
  <td colspan="4" align="right">付款金额：<font style="font-size:18px; color:#F00"><%=lz_money(Rs("rmb"))%></font>元</td>
  </tr>
  <tr>
  <td colspan="4" style="font-weight:bold; border-bottom:1px #E1E1E1 solid">收货信息</td>
  </tr>
<tr>
  <td align="right">收货地址：</td>
  <td colspan="3"><%=rs("name")%>，<%=rs("tel")%>，<%=rs("address")%>，(QQ:<%=rs("QQ")%>)</td>
 </tr>
<tr>
  <td align="right">快递公司：</td>
  <td colspan="3"><%=kd_title(rs("kddm"))%></td>
</tr>
<tr>
  <td align="right">快递单号：</td>
  <td colspan="3">	<%=rs("kddm")%></td>
</tr>
<tr>
  <td align="right">其它说明：</td>
  <td colspan="3"><%=rs("sm")%></td>
</tr>
<%state=rs("state") 
if state=1 then
response.Write("<tr>")
response.Write("<td align=""right"">订单情况：</td>")
response.Write("<td colspan=""3""><div style=""text-align:center;line-height:35px"">您的订单尚未(付款)处理，您可以请<a href="""&dir&"Order/"&alipayLX&"/alipayapi_re.asp?id="&rs("id")&""" title=""点击这里重新付款""><font style=color:#FF0000;font-size:14px;>点击这里</font></a>完成付款!</div></td>")
response.Write(" </tr>")
elseif state=2 then
response.Write("<tr>")
response.Write("<td align=""right"">订单情况：</td>")
response.Write("<td colspan=""2""><div style=""text-align:center;line-height:35px""><font style=color:#FF0000;font-size:14px;>等候处理您的订单</font></div></td>")
response.Write(" </tr>")
else%>
<tr>
<td align="right">备注信息：</td>
<td colspan="3"><font color="#FF0000"><%=rs("bz")%></font></td>
</tr>
<%end if%>
</table>
<% if rs("state")<>1 then%>
<div id="retForm">
<div class="txtURL">
<div class="hdtxt">快递公司：<%=kd_title(rs("kddm"))%>
<input name="expressid" type="hidden" id="expressid" value="<%=rs("kddm")%>"/></div>
<div class="dhtxt">快递单号</div>
<input name="expressno" class="dh" type="text" id="expressno" placeholder="请输入快递单号" value="<%=rs("kddh")%>"/>
<input type="submit" value="查询" id="btnSnap" class="btn"/>
</div>
</div>
<div class="txtAboutSnap">
<div id="retData"></div>
</div>
<%end if%>
</div>
<% End If %>
</div>
</div>
   
<div class="main_250 fr" id="main_250">
<div class="left_title"><a title="企业导航"><b>栏目分类</b><span>Column Class</span></a></div>
<div class="left_box">
<!--左侧栏目导航开始-->
<ul class="type_list">
<%=zych_user_nav%>
</ul>
</div>
<!--#include file="left.asp"-->
</div>
</div>
<!--#include file="bottom.asp"-->
</body>
</html>